{% load i18n %}
<tr class="{% if request_id == current_request_id %}djdt-highlighted{% endif %}" id="historyMain_{{ request_id }}" data-request-id="{{ request_id }}">
    <td>
        {{ history_context.history_stats.time|escape }}
    </td>
    <td>
        <p>{{ history_context.history_stats.request_method|escape }}</p>
    </td>
    <td>
        <p>{{ history_context.history_stats.request_url|truncatechars:100|escape }}</p>
    </td>
    <td>
        <button type="button" class="djToggleSwitch" data-toggle-name="historyMain" data-toggle-id="{{ request_id }}">+</button>
        <div class="djUnselected djToggleDetails_{{ request_id }}">
          <table>
            <colgroup>
              <col class="djdt-width-20">
              <col>
            </colgroup>
            <thead>
              <tr>
                <th>{% translate "Variable" %}</th>
                <th>{% translate "Value" %}</th>
              </tr>
            </thead>
            <tbody>
              {% for key, value in history_context.history_stats.data.items %}
                <tr>
                  <td><code>{{ key|pprint }}</code></td>
                  <td><code>{{ value|pprint }}</code></td>
                </tr>
              {% empty %}
                <tr>
                  <td colspan="2">No data</td>
                </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
    </td>
    <td>
        <p>{{ history_context.history_stats.status_code|escape }}</p>
    </td>
    <td class="djdt-actions">
        <form method="get" action="{% url 'djdt:history_sidebar' %}">
            {{ history_context.form.as_div }}
            <button data-request-id="{{ request_id }}" class="switchHistory">Switch</button>
        </form>
    </td>
</tr>
